package com.star.test.entity;

public class Sub extends Base {

    private int z;

    /*public Sub(int x, int y, int z) {
        super(x,y); //调用父类构造函数初始化x，y
        this.z = z; //初始化子类自己的z

        //write your code here
        

    }*/
    public Sub(int x, int y) {
        super(x,y); //调用父类构造函数初始化x，y

    }

    public int getZ() {
        return z;
    }

    @Override
    public void calculate() {
        if (getY() == 0) System.out.println("ERROR");
        else System.out.println(getX() / getY());
    }

    @Override
    public int getX() {
        return (super.getX() * 10);
    }

}